/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package practice;

import java.io.IOException;
import static chanlib.Chan_IO.*;

/**
 * @author robit
 */
public class Rotate{
    /*
      All neccesary to be defined
      including:
      variable, inner class
    */
    // static int A;
    // static void B();
    // static class C

    /*
       One calculation fits all of the cases.
    */
    static void preReckon(){
        return;
    }

    /*
      calculate the answer
    */
    private static void reckon(int line) {
        int N=Int();
        int K=Int();
        char[][]board=new char[N][N];
        for(int i=0;i<N;i++){
            String tmp=String();
            int idx=N-1;
            for(int j=N-1;j>=0;j--){
                if(tmp.charAt(j)!='.')board[i][idx--]=tmp.charAt(j);
            }
            for(;idx>=0;idx--){
                board[i][idx--]='.';
            }
        }
        char color[]={'R','B'};
        int di[]={1,0,1,1};
        int dj[]={0,1,1,-1};
        int mask=0;
        for(int i=0;i<N;i++)
        for(int j=0;j<N;j++)        
Color:      for(int c=0;c<2;c++)
Direction:  for(int d=0;d<4;d++){
                for(int k=0,ii=i,jj=j;k<K;k++,ii+=di[d],jj+=dj[d]){                    
                    if(ii<0||jj<0||ii>=N||jj>=N||board[ii][jj]!=color[c])
                    continue Direction;
                }
                mask|=1<<c;
            }

        String ans="";
        switch(mask){
            case 0:ans ="Neither";break;
            case 1:ans ="Red";break;
            case 2:ans = "Blue";break;
            case 3:ans = "Both";break;
        }
        
        String output=String.format("Case #%d: %s",line,ans);
        writeln(output, OUTFILE);
        writeln(String.format("N=%d K=%d\n%s", N, K, ans),ANALFILE);
        println(output);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        /*
           Pre-computing for all cases
        */

        // Just in case!
        //preReckon();
        //while((char)read()!='P');

        /*
          Input-output
        */
        boolean test=false;
        boolean small=false;
        String prob="A";
        String filename;
        if(test) filename="test";
        else{
            if(small) filename=prob+"-small-practice";
            else filename=prob+"-large-practice";
        }
        try {
            /*
               Init IO,plus determination of input line number
             */
            int lineNums = initFileIO(filename);
            for (int i = 1; i <= lineNums; i++) {
                reckon(i);
            }
        } finally {
            endIO();
        }
    }

}
